package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
       File file = new File("./demo.txt");
        //获取文件大小，单位是字节
        long len = file.length();
        System.out.println(len);
        //获取文件名字
        String name = file.getName();
        System.out.println(name);
        //是否可读
        boolean b1 = file.canRead();
        System.out.println(b1);
        //是否可写
        boolean b2 = file.canWrite();
        System.out.println(b2);
        //是否隐藏
        boolean hidden = file.isHidden();
        System.out.println(hidden);

    }
}
